package com.qf.utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * author:z
 * time:2021/12/13 15:06
 * description:获取es的客户端
 */
public class EsClient {
    public static RestHighLevelClient getClient() {
        HttpHost httpHost = new HttpHost("192.168.85.128", 9200);
        RestClientBuilder builder = RestClient.builder(httpHost);
        RestHighLevelClient client = new RestHighLevelClient(builder);
        return client;
    }
}

